<!doctype html>
<html>
  <head>
    <title>Test Page for jquery.timeout</title>
    <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
    <script type="text/javascript" src="jquery.timeout.js"></script>
  </head>
  <body>
    <p>
      Waiting... <input id="clear" type="button" value="Stop">
    </p>
    <script type="text/javascript">
      var timeout = $.timeout(10000);

      timeout.then(
        function() { alert("timeout elapsed") },
        function() { alert("timeout cleared") }
      );

      $("#clear").click(function() {
        timeout.clear();
      });
    </script>
  </body>
</html>
